#ifndef CONTROLCOMMAND_H
#define CONTROLCOMMAND_H

#include <QJsonArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonParseError>
#include <QObject>

/**
 * @brief 这个是类表示发送TCPServer指令内容 , for JSON
 */

class ControlCommand : public QObject
{
    Q_OBJECT
public:
    ControlCommand();
    ~ControlCommand();

private:
    QString cmd;
    QString seatnumber;
    QString filename;

public:
    void SetCmd(QString cmd);
    void SetSeatNumber(QString seatnumber);
    void SetFileName(QString filename);

    const QString &GetCmd() const;
    const QString &GetSeatNumber() const;
    const QString &GetFileName() const;

    ControlCommand &operator=(ControlCommand &other);

public:
    QString toJson() const;
    bool FromJson(QString jsonStr);
    bool FromJson(QJsonObject jsonObject);
};

#endif // CONTROLCOMMAND_H
